﻿/*
 * Copyright (C) 2014 Cypress Data Defense, LLC    
 * oss@cypressdefense.com
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
*/

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CypressDefense.Security.Shim.Configuration.Csp
{
    public class CspElement : Base.HeaderBase
    {
        [ConfigurationProperty("reportOnly", IsRequired = false, DefaultValue = false)]
        public bool ReportOnly
        {
            get
            {
                return (bool)this["reportOnly"];
            }
            set
            {
                this["reportOnly"] = value;
            }
        }

        [ConfigurationProperty("defaultSource", IsRequired = false)]
        public CspSourceBaseElement DefaultSource
        {
            get
            {
                return (CspSourceBaseElement)this["defaultSource"];
            }
            set
            {
                this["defaultSource"] = value;
            }
        }

        [ConfigurationProperty("scriptSource", IsRequired = false)]
        public ScriptSourceElement ScriptSource
        {
            get
            {
                return (ScriptSourceElement)this["scriptSource"];
            }
            set
            {
                this["scriptSource"] = value;
            }
        }

        [ConfigurationProperty("objectSource", IsRequired = false)]
        public CspSourceBaseElement ObjectSource
        {
            get
            {
                return (CspSourceBaseElement)this["objectSource"];
            }
            set
            {
                this["objectSource"] = value;
            }
        }

        [ConfigurationProperty("styleSource", IsRequired = false)]
        public StyleSourceElement StyleSource
        {
            get
            {
                return (StyleSourceElement)this["styleSource"];
            }
            set
            {
                this["styleSource"] = value;
            }
        }

        [ConfigurationProperty("imageSource", IsRequired = false)]
        public CspSourceBaseElement ImageSource
        {
            get
            {
                return (CspSourceBaseElement)this["imageSource"];
            }
            set
            {
                this["imageSource"] = value;
            }
        }

        [ConfigurationProperty("mediaSource", IsRequired = false)]
        public CspSourceBaseElement MediaSource
        {
            get
            {
                return (CspSourceBaseElement)this["mediaSource"];
            }
            set
            {
                this["mediaSource"] = value;
            }
        }

        [ConfigurationProperty("frameSource", IsRequired = false)]
        public CspSourceBaseElement FrameSource
        {
            get
            {
                return (CspSourceBaseElement)this["frameSource"];
            }
            set
            {
                this["frameSource"] = value;
            }
        }

        [ConfigurationProperty("fontSource", IsRequired = false)]
        public CspSourceBaseElement FontSource
        {
            get
            {
                return (CspSourceBaseElement)this["fontSource"];
            }
            set
            {
                this["fontSource"] = value;
            }
        }

        [ConfigurationProperty("connectSource", IsRequired = false)]
        public CspSourceBaseElement ConnectSource
        {
            get
            {
                return (CspSourceBaseElement)this["connectSource"];
            }
            set
            {
                this["connectSource"] = value;
            }
        }

        [ConfigurationProperty("reportUri", IsRequired = false)]
        public CspSourceBaseElement ReportUri
        {
            get
            {
                return (CspSourceBaseElement)this["reportUri"];
            }
            set
            {
                this["reportUri"] = value;
            }
        }
    }
}
